use snafu::Snafu;
use crate::core::error::request_error::RequestError;

#[derive(Debug, Snafu)]
#[snafu(visibility(pub(crate)))]
pub enum NotFoundError {
    #[snafu(display("The job with id {id} no found"))]
    Job {
        id: usize,
    },

    #[snafu(display("Failed to get parameter with name {filed_name}"))]
    Field {
        filed_name: String,
    },
}

impl From<NotFoundError> for RequestError {
    fn from(value: NotFoundError) -> Self {
        RequestError::NotFound {source: value}
    }
}